#include"BleKeyboard.h"
#include<Arduino.h>
BleKeyboard bleKeyboard ("first" , "LIUWANG",100);//名称，制造商，电量


#define button 0
#define button_read digitalRead(button)


void setup() {
  Serial.begin(115200);
  Serial.println("Starting BLE work");
  pinMode(button, INPUT);
  bleKeyboard.begin();

}

void loop() {
  if (bleKeyboard.isConnected()){
    
    if(button_read == 0){
      delay(200);
        if(button_read == 0){
        Serial.println("Sending_...");
        bleKeyboard.press(KEY_LEFT_CTRL);
        bleKeyboard.press(KEY_RIGHT_SHIFT);
        bleKeyboard.press(KEY_ESC);
        delay(1000);
        bleKeyboard.releaseAll();
        /*bleKeyboard.print("Hello");
        delay(1000);
        Serial.println("Waiting 10 seconds...");*/
        }
    }


  }

}
